// The docstring element which reuses parts of the Bulma card component
details.docstring {
  margin-bottom: 1em;
  background-color: $documenter-docstring-background;
  border: $documenter-docstring-border-width solid $border;
  border-radius: $documenter-docstring-border-radius;
  box-shadow: $documenter-docstring-shadow;
  max-width: 100%;

  > summary {
    list-style-type: none;
    align-items: stretch;
    padding: $documenter-docstring-header-padding;

    background-color: $documenter-docstring-header-background;
    box-shadow: $card-header-shadow;
    box-shadow: none;
    border-bottom: 1px solid $border;
    overflow: auto;

    code {
      background-color: transparent;
    }

    .docstring-article-toggle-button {
      min-width: 1.1rem;
      padding: 0.2rem 0.2rem 0.2rem 0;
    }

    .docstring-binding {
      margin-right: 0.3em;
    }
    .docstring-category {
      margin-left: 0.3em;
    }
  }

  > summary::before {
    content: '\f054';  // fa-chevron-right
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    min-width: 1.1rem;
    color: #2E63BD;
    display: inline-block;
  }

  > section {
    position: relative;
    padding: $documenter-docstring-body-padding;

    border-bottom: 1px solid $border;
    &:last-child {
      border-bottom: none;
    }

    > a.docs-sourcelink {
      transition: opacity 0.3s;
      opacity: 0;
      position: absolute;
      right: $documenter-docstring-body-padding-h / 2;
      bottom: $documenter-docstring-body-padding-v / 2;
      @extend .tag;
      @extend .is-primary;
      @extend .is-size-7;

      &:focus {
        opacity: 1!important;
      }
    }
  }

  &:hover > section > a.docs-sourcelink {
    opacity: 0.2;
  }

  &:focus-within > section > a.docs-sourcelink {
    opacity: 0.2;
  }

  & > section:hover a.docs-sourcelink {
    opacity: 1;
  }
}

details.docstring[open] > summary::before {
  content: "\f078";  // fa-chevron-down
}
